#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int x, y, S;
	scanf("%d %d", &x, &y);

	if (x > y)
		S = 50 * (x - y);
	else if (x < y)
		S = 50 * (y - x);
	else
		S = 0;

	printf("%d", S);
	return 0;
}